AddCSLuaFile( "cl_init.lua" ) // Make sure clientside
AddCSLuaFile( "shared.lua" ) // and shared scripts are sent.
  
include('shared.lua')
 
function ENT:Initialize()
 
	self.Entity:SetModel( "models/props_junk/rock001a.mdl" )
	self.Entity:PhysicsInit( SOLID_VPHYSICS ) // Make us work with physics,
	self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) // after all, gmod is a physics
	self.Entity:SetSolid( SOLID_VPHYSICS ) // Toolbox

	local phys = self.Entity:GetPhysicsObject()
	if (phys:IsValid()) then
		phys:Wake()
	end
end
   
function ENT:Use( activator, caller )
	self.Entity:Remove()
 
	if ( activator:IsPlayer() ) then

		 // Give the collecting player 1 metal
		if(activator.inventory.metal==nil) then
			activator.inventory.metal=0
		end

		activator.inventory.metal=activator.inventory.metal+1
		//activator:SetNWInt("metal",activator:GetNWInt("metal")+1)
		activator:ChatNotify("Picked up one metal ore")
	end 
end
   
function ENT:Think()
  // We don't need to think, we are just a prop after all!
end 